(function(w){
    var adapter = function(){
        this.name = 'wx';
        this.lvl10 = {};
    };
    adapter.showAd = function(){
         //wx.createBannerAd();
    };
    adapter.save=function(data){ 
        let OpenDataContext = wx.getOpenDataContext();
        OpenDataContext.postMessage({
            type:3,data:data
        });
        return true;
    }

    adapter.getFriends = function(data){
        let OpenDataContext = wx.getOpenDataContext();
        OpenDataContext.postMessage({
            type:1,level:data
        });
        return true;
    }
    adapter.login = function(){}


    /**
     * 按10个等级归为1组的数据保存
    */
    adapter.saveLvlData=function(level,lvlData) {
        let OpenDataContext = wx.getOpenDataContext();
        OpenDataContext.postMessage({
            type:4,data:lvlData,level:level
        });
        return true;
    };

    adapter.loadLvlData = function(level){
        let OpenDataContext = wx.getOpenDataContext();
        OpenDataContext.postMessage({
            type:5,level:level
        });
        return true;
    }
    
    w.adapter = adapter;

})(window);